package com.cw.async.callback;

import java.util.concurrent.CompletableFuture;

/**
 * TODO
 *
 * @author chenw
 * @date 2020/7/15
 */
public class AsyncCallback {
    public static Boolean execute() {
        CompletableFuture.supplyAsync(() -> 1)
            .thenApply(i -> i + 1)
            .thenApply(i -> i * 2)
            .whenComplete((r, e) -> System.out.println(r + "---"));
        return true;
    }
    public static void main(String[] args) {
        execute();
    }
}
